<html>  
  
<head>  
  
<title>My Facebook Login Page</title>  
  
</head>  
  
<body>  
<%
String YOUR_APP_ID="256662071116007";
String YOUR_REDIRECT_URI1="http://www.fiyatineydi.com/FN/facebook2.jsp";
String SOME_ARBITRARY_BUT_UNIQUE_STRING="123987456asdfsdf";
String COMMA_SEPARATED_LIST_OF_PERMISSION_NAMES="user_photos";
String URL7="https://www.facebook.com/dialog/oauth?type=client_cred&client_id="+YOUR_APP_ID+"&redirect_uri="+YOUR_REDIRECT_URI1+"&scope="+COMMA_SEPARATED_LIST_OF_PERMISSION_NAMES+"&state="+SOME_ARBITRARY_BUT_UNIQUE_STRING; 

if(request.getParameter("code")!=null)
{
String CODE_GENERATED_BY_FACEBOOK=request.getParameter("code");
String YOUR_REDIRECT_URI2="http://www.fiyatineydi.com/FN/FB";
String YOUR_APP_SECRET="9c329e2cc15e5924654e21d31f683fef";
String URL2="https://graph.facebook.com/oauth/access_token?type=client_cred&client_id="+YOUR_APP_ID+"&redirect_uri="+YOUR_REDIRECT_URI2+"&client_secret="+YOUR_APP_SECRET+"&code="+CODE_GENERATED_BY_FACEBOOK;

response.sendRedirect(response.encodeRedirectURL(URL2));

URL oracle = new URL("http://www.oracle.com/");
BufferedReader in = new BufferedReader(
new InputStreamReader(oracle.openStream()));

String inputLine;
while ((inputLine = in.readLine()) != null)
    System.out.println(inputLine);
in.close();

}
else
{

response.sendRedirect(response.encodeRedirectURL(URL7));
} 
%>

</body>  
  
</html>  